package finalproject.model.rooms;

import java.util.ArrayList;

import finalproject.model.player.Player;
import finalproject.model.player.fight.Ability;
import finalproject.model.player.pet.Pet;
import finalproject.view.StringManager;

/**
 * Pet Exchange room containe a very rare pet with fabulous ability
 * 
 * @author Dahmoul Salah
 */
public class PetExchangeRoom extends Room {

	
	public PetExchangeRoom(String description, boolean isLighted) {
		super(description, isLighted);
		
	}

	@Override
	public boolean prepareActivity(Player p) {
		
		return false;
	}

	@Override
	public boolean doActivity(Player p) {
		
		
		p.setPet(rareRandomPet());
		StringManager.outPut("getmewtow");
		return true;
	}
	
	/**
	 * generate a rare pseudo random pet to set in the room
	 * @return pet
	 * 
	 */
	public Pet rareRandomPet(){
		
		
		int rnd = (int) (Math.random() * ( 3 - 0 ));
		ArrayList<Ability> abilities = new ArrayList<Ability>();
		Pet pet;
		switch (rnd) {
		case 0:
			abilities.add(new Ability("psyko", 20));
			abilities.add(new Ability("ultralaser", 30));
			abilities.add(new Ability("choc-mental", 10));
			abilities.add(new Ability("torgnioles", 5));
			pet = new Pet("Mewtow", abilities);
			break;
		case 1:
			abilities.add(new Ability("ecrasface", 15));
			abilities.add(new Ability("ultralaser", 30));
			abilities.add(new Ability("choc-mental", 10));
			abilities.add(new Ability("ultimapoing", 20));
			pet = new Pet("Mew", abilities);
			break;
		case 2:
			abilities.add(new Ability("tornade", 10));
			abilities.add(new Ability("ultralaser", 30));
			abilities.add(new Ability("hydrocanon", 25));
			abilities.add(new Ability("torgnioles", 5));
			pet = new Pet("lugia", abilities);
			break;

		default:
			abilities.add(new Ability("trempete", 1));
			pet = new Pet("magicarpe", abilities);
			
			break;
		}
		
		return pet;
	}
}
